﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Game_Engine
{
    public class RandomTextGenerator
    {
        public Random Random { get; set; }
        public String Text { get; set; }

        public RandomTextGenerator()
        {
            Random = new Random();
            Text = "";
        }

        public String generateString(int length)
        {
            Int32[] ints = new Int32[length];
            for (int i = 0; i < length; i++)
                ints[i] = Random.Next(32, 128);
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < length; i++)
                sb.Append(Convert.ToChar(ints[i]));

            Text = sb.ToString();
            return Text;
        }
    }
}
